<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoriesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('categories', function(Blueprint $table)
		{
            $table->increments('id',11);
//            $table->primary('cat_id');
            $table->unsignedInteger('user_id', false);
            $table->foreign('user_id')
                ->references('id')->on('users')->onDelete('cascade');
            $table->string('cat_name',100)->nullable();
            $table->tinyInteger('position',4)->nullable();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('categories');
	}

}
